package com.bensonbasement.snorflux.server.verbs;

import com.bensonbasement.snorflux.commands.IAPFormula;
import com.bensonbasement.snorflux.commands.StaticAPFormula;
import com.bensonbasement.snorflux.commands.TargetMap;
import com.bensonbasement.snorflux.server.world.Actor;
import com.bensonbasement.snorflux.server.world.Entity;
import com.bensonbasement.snorflux.server.world.SmallEntity;

public class GetVerb extends Verb {

	public static final GetVerb GET = new GetVerb();
	private static final int APCOST = 4;
	
	private GetVerb() {
		super("Get", "handbutton");
	}
	
	@Override
	protected void actuallyExecute(Actor actor, Entity object, TargetMap targets) {
		SmallEntity item = (SmallEntity) object;
		item.setLocation(actor);
	}
	
	@Override
	public boolean canActorPerform(Actor actor) {
		return true;
	}
	
	@Override
	public boolean checkRelevant(Actor actor, Entity object) {
		SmallEntity item = (SmallEntity) object;
		return (item.getLocation() == actor.getLocation());
	}
	
	@Override
	public boolean checkEnabled(Actor actor, Entity object) {
		return true;
	}
	
	@Override
	public IAPFormula getAPFormula(Actor actor, Entity object) {
		return new StaticAPFormula(APCOST);
	}

}
